# Context Engineering System
import argparse
from typing import Dict
from apps.ces.expand_context_app import ExpandContextApp
from apps.ces.control_loop_app import ControlLoopApp
from apps.ces.context_rag_app import ContextRagApp

def main(params:Dict = {}) -> None:
    print(f'Context Engineering System v0.0.1')
    if params['run_mode'] == 1:
        ExpandContextApp.startup(params=params)
    elif params['run_mode'] == 2:
        ControlLoopApp.startup(params=params)
    elif params['run_mode'] == 3:
        ContextRagApp.startup(params=params)

def parse_args() -> argparse.Namespace:
    parser = argparse.ArgumentParser()
    parser.add_argument(
        '--run_mode', action='store',
        type=int, default=1, dest='run_mode',
        help='run mode'
    )
    parser.add_argument(
        '--task', action='store',
        type=int, default=1, dest='task',
        help='task name'
    )
    return parser.parse_args()

if '__main__' == __name__:
    args = parse_args()
    params = vars(args)
    main(params=params)